<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>嘻嘻嘻哈哈哈博客</title>
    <link rel="stylesheet" type="text/css" href="../static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../static/css/blog.css">
    <script src="../static/js/jquery.min.js"></script>
</head>
<body class="user-select">
<header class="header">
    <nav class="navbar navbar-default" id="navbar1"
         style="opacity: 0.9;z-index: 9999;">
        <div class="container" id="nav">
            <div class="navbar-header logo-site">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#header-navbar" aria-expanded="false"><span class="sr-only"></span> <span
                        class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button>
                <h1 class="logo hvr-bounce-in">
                    <a href="/" title="嘻嘻嘻哈哈哈博客">嘻嘻嘻哈哈哈博客</a>
                </h1>
            </div>
        </div>
    </nav>
</header>
<section class="container" id="detail">
    <div class="content-wrap">
        <div class="content">
            <header class="article-header">
                <h1 class="article-title"><a href="javascript:;">springboot thymeleaf和shiro 整合——按钮可见性</a></h1>
                <div class="article-meta">
                    <span class="item article-meta-time">
                        <time class="time" data-toggle="tooltip" data-placement="bottom"><i class="glyphicon glyphicon-time"></i> <span>Wed Sep 23 11:57:16 CST 2020</span></time>
                    </span>
                </div>
            </header>
            <article class="article-content" style="height: auto !important;"><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px; color: rgb(61, 70, 77); font-family: &quot;Pingfang SC&quot;, STHeiti, &quot;Lantinghei SC&quot;, &quot;Open Sans&quot;, Arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, SimSun, sans-serif; font-size: 16px; background-color: rgb(248, 248, 248);">添加依赖</p><pre class="hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);">&lt;<span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">dependency</span>&gt;</span><code class="hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 10px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 4px; font-size: 13px; line-height: 1.4; word-wrap: normal; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;"> 
   <span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&lt;</span><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">groupId</span></span></span><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&gt;</span></span>com.github.theborakompanioni<span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&lt;/</span><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">groupId</span></span></span><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&gt;</span></span>
    <span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&lt;</span><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">artifactId</span></span></span><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&gt;</span></span>thymeleaf-extras-shiro<span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&lt;/</span><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">artifactId</span></span></span><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&gt;</span></span>
    <span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&lt;</span><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">version</span></span></span><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&gt;</span></span></code>1.2.1<code class="hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 10px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 4px; font-size: 13px; line-height: 1.4; word-wrap: normal; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&lt;/</span><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">version</span></span></span><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&gt;</span></span> 
<span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&lt;/</span><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);"><span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">dependency</span></span></span><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">&gt;</span></span></code></pre><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px; color: rgb(61, 70, 77); font-family: &quot;Pingfang SC&quot;, STHeiti, &quot;Lantinghei SC&quot;, &quot;Open Sans&quot;, Arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, SimSun, sans-serif; font-size: 16px; background-color: rgb(248, 248, 248);">&nbsp;</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px; color: rgb(61, 70, 77); font-family: &quot;Pingfang SC&quot;, STHeiti, &quot;Lantinghei SC&quot;, &quot;Open Sans&quot;, Arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, SimSun, sans-serif; font-size: 16px; background-color: rgb(248, 248, 248);">在shiro的configuration中配置</p><pre class="hljs java" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;"><span class="hljs-meta" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(127, 159, 127);">@Bean</span>
    <span class="hljs-function" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"><span class="hljs-keyword" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);">public</span> ShiroDialect <span class="hljs-title" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">shiroDialect</span><span class="hljs-params" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">()</span> </span>{
        <span class="hljs-keyword" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);">return</span> <span class="hljs-keyword" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);">new</span> ShiroDialect();
    }</pre><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px; color: rgb(61, 70, 77); font-family: &quot;Pingfang SC&quot;, STHeiti, &quot;Lantinghei SC&quot;, &quot;Open Sans&quot;, Arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, SimSun, sans-serif; font-size: 16px; background-color: rgb(248, 248, 248);">&nbsp;</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px; color: rgb(61, 70, 77); font-family: &quot;Pingfang SC&quot;, STHeiti, &quot;Lantinghei SC&quot;, &quot;Open Sans&quot;, Arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, SimSun, sans-serif; font-size: 16px; background-color: rgb(248, 248, 248);">在html中加入xmlns</p><pre class="hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;"><span class="hljs-tag" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);">&lt;<span class="hljs-name" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(239, 239, 143);">html</span> <span class="hljs-attr" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">lang</span>=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"zh_CN"</span> <span class="hljs-attr" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">xmlns:th</span>=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"http://www.thymeleaf.org"</span>
      <span class="hljs-attr" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">xmlns:shiro</span>=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"http://www.pollix.at/thymeleaf/shiro"</span>&gt;</span></pre><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px; color: rgb(61, 70, 77); font-family: &quot;Pingfang SC&quot;, STHeiti, &quot;Lantinghei SC&quot;, &quot;Open Sans&quot;, Arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, SimSun, sans-serif; font-size: 16px; background-color: rgb(248, 248, 248);">例子</p><pre class="hljs scala" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;">&lt;button shiro:hasPermission=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"sys:user:add"</span> <span class="hljs-class" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"><span class="hljs-keyword" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);">type</span></span>=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"button"</span> <span class="hljs-class" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"><span class="hljs-keyword" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);">class</span></span>=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"btn &nbsp;btn-primary"</span> onclick=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"add()"</span>&gt;
&nbsp;&nbsp; &lt;i <span class="hljs-class" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"><span class="hljs-keyword" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(227, 206, 171);">class</span></span>=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"fa fa-plus"</span> aria-hidden=<span class="hljs-string" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(204, 147, 147);">"true"</span>&gt;&lt;/i&gt;添加
&lt;/button&gt;</pre></article>
            <div class="relates">
                <div class="title">
                    <h3>相关推荐</h3>
                </div>
                <ul>
                    <li>
                        <a href="/news/detail_112.html"> SpringBoot 在启动时运行代码</a>
                    </li>
                    <li>
                        <a href="/news/detail_110.html">spring boot 图片上传后的图片读取路径在win与linux环境配置的差别</a>
                    </li>
                    <li>
                        <a href="/news/detail_109.html">spring-boot整合ehcache实现缓存机制</a>
                    </li>
                    <li>
                        <a href="/news/detail_108.html">spring boot ehcache整合</a>
                    </li>
                    <li>
                        <a href="/news/detail_100.html">springboot thymeleaf和shiro 整合——按钮可见性</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</section>
<footer class="footer">
    <div class="container">
        <p>本站[<a href="http://xiaochancy.gitee.io/java/">嘻嘻嘻哈哈哈博客</a>]的部分内容来源于网络，若侵犯到您的利益，请联系站长删除！谢谢！Powered By [
        </p>
    </div>
    <div id="gotop"><a class="gotop"></a></div>
</footer>
<script src="../static/js/bootstrap.min.js"></script>
<script src="../static/js/blog.js"></script>
</body>
</html>
